package com.chinasofti.comparble2;

import com.chinasofti.comparble.Student;

import java.util.TreeSet;


public class Test02 {
    public static void main(String[] args) {
//        TreeSet<Student> treeSet = new TreeSet<>();
//        Student student1 = new Student("zs",40);
//        Student student2 = new Student("ls",38);
//        Student student3 = new Student("ww",40);
//        Student student4 = new Student("ez",3);
//        Student student5 = new Student("xm",18);
//        treeSet.add(student1);
//        treeSet.add(student2);
//        treeSet.add(student3);
//        treeSet.add(student4);
//        treeSet.add(student5);
//        for(Student str : treeSet){
//            System.out.println(str);
//        }
        TreeSet<Student> treeSet = new TreeSet<>();
        Student student1 = new Student("张三",40);
        Student student2 = new Student("李四",30);
        Student student3 = new Student("王五",60);
        treeSet.add(student1);
        treeSet.add(student2);
        treeSet.add(student3);
        for (Student str : treeSet){
            System.out.println(str);
        }
    }
}
